home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / MacX25 / MacX25 Developer's Kit / MacX25_Interfaces / CIncludes / X25Defn.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-21  |  4.4 KB  |  169 lines  |  [TEXT/MPS ]

  1.  
  2.  
  3. /*************************************************************************
  4. **                                                                       *
  5. **     Miscellaneous definitions used by the X25 interface modules         *
  6. **                                                                       *
  7. **-----------------------------------------------------------------------*
  8. **                                                                       *
  9. **               Copyright Apple Computer, Inc. 1987-88                  *
  10. **                         All Rights Reserved                           *
  11. **                     Apple Computer Confidential                       *
  12. **                                                                       *
  13. **-----------------------------------------------------------------------*
  14. **                                                                       *
  15. **  Revision History:                                                    *
  16. **                                                                       * 
  17. **                                                                       *
  18. **                                                                       *
  19. *************************************************************************/
  20.  
  21.  
  22.  
  23. #include    <X25Types.h>
  24. #include    <initab.h>
  25.  
  26.  
  27. /*
  28.  *    Locally used message code definitions
  29.  */
  30.  
  31. #define X25INTER        0x0c8        /* message code for waking up X.25 task                 */
  32.  
  33.  
  34.  
  35. /********************************************************************************************
  36.  *
  37.  *    The following structures define the format of system and link configuration messages
  38.  *
  39.  *******************************************************************************************/
  40.  
  41.  
  42.  
  43. /*     The following structure defines a system initialization table message. It is used for two
  44.     purposes, first and formost by the administration program  to provide link parameters 
  45.     to the X25 software. Secondly, it is used by applications to read the system parameters  */
  46.  
  47.  
  48. typedef struct 
  49. {
  50.     X25Msg    sys_header;                    /* defined in file x25server.h    */
  51.     struct     mon_struc    monitor_seg;    /* defined in file Initab.h      */
  52.     struct    swit_struc    switch_seg;        /* defined in file Initab.h      */
  53. #ifdef LMS
  54.     struct    lms_g_struc    lms_seg;        /* defined in file Initab.h      */
  55. #endif
  56.     UWORD    buf_pools[FILLM];            /* defined in file Initab.h      */
  57. }sys_table;
  58.  
  59.  
  60.  
  61. /*     The following structure defines a link initialization table message. It is used for two
  62.     purposes, first and formost by the administration program  to provide link parameters 
  63.     to the X25 software. Secondly, it is used by applications to read the link parameters and 
  64.     local network address. The name, type, and address fields are formatted as follows:
  65.  
  66.     link_name     :    pascal string
  67.     link_type    :    pascal string
  68.     link_address:    pascal string of address digits with the top nibble of each digit cleared
  69.                     
  70.                     Example address of 311040800435 would be formatted as:
  71.                     
  72.                     0c 03 01 01 00 04 00 08 00 00 04 03 05                                        */
  73.  
  74. #define namesize 36
  75. #define addrsize 16
  76.  
  77.  
  78. typedef struct link_table 
  79. {
  80.     X25Msg    link_header;                /* defined in file x25server.h    */
  81.     char    link_name[namesize];    
  82.     char    link_type[namesize];    
  83.     char    dte_address[addrsize];            
  84.     struct     fram_struc    frame_seg;        /* defined in file initab.h      */
  85.     struct    pak_struc    packet_seg;        /* defined in file initab.h      */
  86.     UWORD    pvc_struc[FILL];            /* defined in file initab.h      */
  87. }link_table;
  88.  
  89.  
  90.  
  91.  
  92. pascal    void    illegal()    extern  0x4afc;
  93. pascal    void    noop()    extern  0x4e71;
  94.  
  95.  
  96. #define    NOMEM    0xf0
  97. #define    NOMSG    0xf1
  98.  
  99. #define NIL        ((void *) 0)
  100.  
  101. #define true     1
  102. #define false     0
  103.  
  104. /*
  105.  *    Debug Aids
  106.  */
  107.  
  108. #ifndef NDEBUG
  109. #define assert(exp)                    \
  110.     if ( ! ( exp ) ) {                \
  111.         illegal ( );                \
  112.         };
  113. #else
  114. #define assert(exp)
  115. #endif NDEBUG
  116.  
  117. /*
  118.  *    First Level of debug checking - must be left on at all times
  119.  */
  120.  
  121. #ifndef NDEBUG
  122. #ifdef D1
  123. #define assert_1(exp)                \
  124.     if ( ! ( exp ) ) {                \
  125.         illegal ( );                \
  126.         };
  127. #else
  128. #define assert(exp)
  129. #endif D1
  130. #else
  131. #define assert(exp)
  132. #endif NDEBUG
  133.  
  134. /*
  135.  *    Second Level of debug checking - can be left off
  136.  */
  137.  
  138. #ifndef NDEBUG
  139. #ifdef D2
  140. #define assert_2(exp)                \
  141.     if ( ! ( exp ) ) {                \
  142.         illegal ( );                \
  143.         };
  144. #else
  145. #define assert(exp)
  146. #endif D2
  147. #else
  148. #define assert(exp)
  149. #endif NDEBUG
  150.  
  151. /*
  152.  *    Third Level of debug checking - real nit-picking stuff
  153.  */
  154.  
  155. #ifndef NDEBUG
  156. #ifdef D3
  157. #define assert_3(exp)                \
  158.     if ( ! ( exp ) ) {                \
  159.         illegal ( );                \
  160.         };
  161. #else
  162. #define assert(exp)
  163. #endif D3
  164. #else
  165. #define assert(exp)
  166. #endif NDEBUG
  167.  
  168.         
  169.